<template>
    <div class="right-container">
      <h3>Bottom 组件-----{{ count }}</h3>
      <hr />
      <button @click="add">+1</button>
    </div>
  </template>
  
  <script>
  export default {
    data() {
        return {
            count:0
        }
    },
    methods:{
        add(){
            this.count+=1
            // 触发自定义事件  子组件像父组件传递数据使用this.$emit()
            this.$emit('numchange', this.count)
        }
    }
  }
  </script>
  
  <style lang="less" scoped>
  .right-container {
    padding: 0 20px 20px;
    background-color: rgb(250, 210, 135);
    min-height: 250px;
    flex: 1;
  }
  </style>
  